package a入门.day5.home;

import java.util.Scanner;

public class A {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int[][]m=new int[3][3];
        double sum;

        System.out.println("请输入"+(1)+"班"+(1)+"号同学的成绩：");
        m[0][0]=s.nextInt();
        int max,min;
        max=m[0][0];min=m[0][0];

        for(int i=0;i<m.length;i++){
            sum=0;
            for(int j=0;j<m[i].length;j++){
                if(i==0&&j==0){
                }else {
                    System.out.println("请输入"+(i+1)+"班"+(j+1)+"号同学的成绩：");
                    m[i][j]=s.nextInt();
                }

                sum+=m[i][j];

                if(m[i][j]>max){
                    max=m[i][j];
                }
                if(min>m[i][j]){
                    min=m[i][j];
                }
            }
            System.out.println((i+1)+"班的平均成绩为："+sum/m[i].length);
        }
        System.out.println("全校最高分为："+max);
        System.out.println("全校最低分为："+min);
    }
}
